package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.model.entity.product.Category;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author LT
 * @create 2024-03-25-18:04
 */
@RestController
@RequestMapping("/api/product/index")
//@CrossOrigin()
public class IndexController {

    @Autowired
    ProductService productService;

    @GetMapping
    public Result loadData(){
        Map<String , Object> map = productService.loadData();
        return Result.ok(map);
    }




}
